import Vue from 'vue'
import VueRouter from 'vue-router'



const routes = [
  {
	  
    path: '/',
    component: () => import('../views/home/index.vue'),
	children:[{
		path: '/home',
		name:'Home',
		component: () => import('../views/home/home.vue')
	},
	{
		path: '/sys/user',
		name:'User',
		component: () => import('../views/sys/user/index.vue')
	},
	{
		path: '/sys/role',
		name:'Role',
		component: () => import('../views/sys/role/index.vue')
	},
	{
		path: '/sys/resource',
		name:'Resource',
		component: () => import('../views/sys/resource/index.vue')
	},
	{
		path: '/sys/assignReource',
		name:'AssignReource',
		component: () => import('../views/sys/assignReource/index.vue')
	},
	{
		path: '/sys/assignRoles',
		name:'AssignRoles',
		component: () => import('../views/sys/assignRoles/index.vue')
	}
	]
  },
  {
		path: '/login',
		name:'Login',
		component: () => import('../views/login/index.vue')
	}
]

const router = new VueRouter({
	mode: 'history',
	routes
})


const originalPush = VueRouter.prototype.push
    //修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
        return originalPush.call(this, location).catch(err => err)
    }
	
Vue.use(VueRouter)

export default router
